package com.zb.kc.entity;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author wanggen
 * @since 2020-04-17
 */
@ToString
public class District extends Model<District> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键自增
     */
    private Integer id;

    /**
     * 父类id
     */
    @TableField("parentId")
    private Integer parentId;

    /**
     * 城市的名字
     */
    private String districtName;

    /**
     * 城市的类型，0是国，1是省，2是市，3是区
     */
    private Integer type;

    /**
     * 地区所处的层级
     */
    private Integer hierarchy;

    /**
     * 层级序列
     */
    private String districtSqe;

    public List<District> getChildren() {
        return children;
    }

    public void setChildren(List<District> children) {
        this.children = children;
    }

    @TableField(exist = false)
    private List<District> children;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getHierarchy() {
        return hierarchy;
    }

    public void setHierarchy(Integer hierarchy) {
        this.hierarchy = hierarchy;
    }

    public String getDistrictSqe() {
        return districtSqe;
    }

    public void setDistrictSqe(String districtSqe) {
        this.districtSqe = districtSqe;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
